﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.DataAccessLayer;

namespace BingZi.HY.Core.Entities.Center
{
	/// <summary>
	/// 支付卡信息
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("支付卡信息")]
	[BindTable("app_PayCard", Description = "支付卡信息", ConnName = "Center", DbType = DatabaseType.SqlServer)]
	public partial class app_PayCard
	{
		#region 属性
		private Int32 _pID;
		/// <summary>
		/// 充值卡序号
		/// </summary>
		[Description("充值卡序号")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "pID", "充值卡序号", "", "int", 10, 0, false)]
		public Int32 pID
		{
			get { return _pID; }
			set { if (OnPropertyChange("pID", value)) _pID = value; }
		}

        private Int32 _p_Type;
		/// <summary>
		/// 卡类型
		/// </summary>
		[Description("卡类型")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(2, "p_Type", "卡类型", "", "tinyint", 3, 0, false)]
        public Int32 p_Type
		{
			get { return _p_Type; }
			set { if (OnPropertyChange("p_Type", value)) _p_Type = value; }
		}

		private String _p_Name;
		/// <summary>
		/// 卡名称
		/// </summary>
		[Description("卡名称")]
		[DataObjectField(false, false, false, 50)]
		[BindColumn(3, "p_Name", "卡名称", "", "nvarchar(50)", 0, 0, true)]
		public String p_Name
		{
			get { return _p_Name; }
			set { if (OnPropertyChange("p_Name", value)) _p_Name = value; }
		}

		private Double _p_Value;
		/// <summary>
		/// 积分额度
		/// </summary>
		[Description("积分额度")]
		[DataObjectField(false, false, false, 53)]
		[BindColumn(4, "p_Value", "积分额度", "", "float", 53, 0, false)]
		public Double p_Value
		{
			get { return _p_Value; }
			set { if (OnPropertyChange("p_Value", value)) _p_Value = value; }
		}

		private String _p_Des;
		/// <summary>
		/// 卡描述
		/// </summary>
		[Description("卡描述")]
		[DataObjectField(false, false, true, 512)]
		[BindColumn(5, "p_Des", "卡描述", "", "nvarchar(512)", 0, 0, true)]
		public String p_Des
		{
			get { return _p_Des; }
			set { if (OnPropertyChange("p_Des", value)) _p_Des = value; }
		}

		private String _p_CardID;
		/// <summary>
		/// 充值卡号
		/// </summary>
		[Description("充值卡号")]
		[DataObjectField(false, false, false, 12)]
		[BindColumn(6, "p_CardID", "充值卡号", "", "char(12)", 0, 0, false)]
		public String p_CardID
		{
			get { return _p_CardID; }
			set { if (OnPropertyChange("p_CardID", value)) _p_CardID = value; }
		}

		private String _p_CardPin;
		/// <summary>
		/// 充值密码
		/// </summary>
		[Description("充值密码")]
		[DataObjectField(false, false, false, 12)]
		[BindColumn(7, "p_CardPin", "充值密码", "", "char(12)", 0, 0, false)]
		public String p_CardPin
		{
			get { return _p_CardPin; }
			set { if (OnPropertyChange("p_CardPin", value)) _p_CardPin = value; }
		}

		private DateTime _p_CreateTime;
		/// <summary>
		/// 创建时间
		/// </summary>
		[Description("创建时间")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(8, "p_CreateTime", "创建时间", "", "datetime", 3, 0, false)]
		public DateTime p_CreateTime
		{
			get { return _p_CreateTime; }
			set { if (OnPropertyChange("p_CreateTime", value)) _p_CreateTime = value; }
		}

		private DateTime _p_ExpiredTime;
		/// <summary>
		/// 过期时间
		/// </summary>
		[Description("过期时间")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(9, "p_ExpiredTime", "过期时间", "", "datetime", 3, 0, false)]
		public DateTime p_ExpiredTime
		{
			get { return _p_ExpiredTime; }
			set { if (OnPropertyChange("p_ExpiredTime", value)) _p_ExpiredTime = value; }
		}

		private DateTime _p_RechargeTime;
		/// <summary>
		/// 使用时间
		/// </summary>
		[Description("使用时间")]
		[DataObjectField(false, false, true, 3)]
		[BindColumn(10, "p_RechargeTime", "使用时间", "", "datetime", 3, 0, false)]
		public DateTime p_RechargeTime
		{
			get { return _p_RechargeTime; }
			set { if (OnPropertyChange("p_RechargeTime", value)) _p_RechargeTime = value; }
		}

		private Int32 _UserID;
		/// <summary>
		/// 绑定用户(0为不绑定,使用后绑定)
		/// </summary>
		[Description("绑定用户(0为不绑定,使用后绑定)")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(11, "UserID", "绑定用户(0为不绑定,使用后绑定)", "", "int", 10, 0, false)]
		public Int32 UserID
		{
			get { return _UserID; }
			set { if (OnPropertyChange("UserID", value)) _UserID = value; }
		}

		private Int32 _p_State;
		/// <summary>
		/// 状态,0正常,1使用,2锁定
		/// </summary>
		[Description("状态,0正常,1使用,2锁定")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(12, "p_State", "状态,0正常,1使用,2锁定", "", "tinyint", 3, 0, false)]
        public Int32 p_State
		{
			get { return _p_State; }
			set { if (OnPropertyChange("p_State", value)) _p_State = value; }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "pID" : return _pID;
					case "p_Type" : return _p_Type;
					case "p_Name" : return _p_Name;
					case "p_Value" : return _p_Value;
					case "p_Des" : return _p_Des;
					case "p_CardID" : return _p_CardID;
					case "p_CardPin" : return _p_CardPin;
					case "p_CreateTime" : return _p_CreateTime;
					case "p_ExpiredTime" : return _p_ExpiredTime;
					case "p_RechargeTime" : return _p_RechargeTime;
					case "UserID" : return _UserID;
					case "p_State" : return _p_State;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "pID" : _pID = Convert.ToInt32(value); break;
                    case "p_Type": _p_Type = Convert.ToInt32(value); break;
					case "p_Name" : _p_Name = Convert.ToString(value); break;
					case "p_Value" : _p_Value = Convert.ToDouble(value); break;
					case "p_Des" : _p_Des = Convert.ToString(value); break;
					case "p_CardID" : _p_CardID = Convert.ToString(value); break;
					case "p_CardPin" : _p_CardPin = Convert.ToString(value); break;
					case "p_CreateTime" : _p_CreateTime = Convert.ToDateTime(value); break;
					case "p_ExpiredTime" : _p_ExpiredTime = Convert.ToDateTime(value); break;
					case "p_RechargeTime" : _p_RechargeTime = Convert.ToDateTime(value); break;
					case "UserID" : _UserID = Convert.ToInt32(value); break;
                    case "p_State": _p_State = Convert.ToInt32(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得支付卡信息字段名的快捷方式
		/// </summary>
		public class _
		{
			///<summary>
			/// 充值卡序号
			///</summary>
			public const String pID = "pID";

			///<summary>
			/// 卡类型
			///</summary>
			public const String p_Type = "p_Type";

			///<summary>
			/// 卡名称
			///</summary>
			public const String p_Name = "p_Name";

			///<summary>
			/// 积分额度
			///</summary>
			public const String p_Value = "p_Value";

			///<summary>
			/// 卡描述
			///</summary>
			public const String p_Des = "p_Des";

			///<summary>
			/// 充值卡号
			///</summary>
			public const String p_CardID = "p_CardID";

			///<summary>
			/// 充值密码
			///</summary>
			public const String p_CardPin = "p_CardPin";

			///<summary>
			/// 创建时间
			///</summary>
			public const String p_CreateTime = "p_CreateTime";

			///<summary>
			/// 过期时间
			///</summary>
			public const String p_ExpiredTime = "p_ExpiredTime";

			///<summary>
			/// 使用时间
			///</summary>
			public const String p_RechargeTime = "p_RechargeTime";

			///<summary>
			/// 绑定用户(0为不绑定,使用后绑定)
			///</summary>
			public const String UserID = "UserID";

			///<summary>
			/// 状态,0正常,1使用,2锁定
			///</summary>
			public const String p_State = "p_State";
		}
		#endregion
	}
}